/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package entity;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author Admin
 */
@Entity
@Table(name = "PODANIA")
@NamedQueries({
    @NamedQuery(name = "Podania.findAll", query = "SELECT p FROM Podania p"),
    @NamedQuery(name = "Podania.findByPodId", query = "SELECT p FROM Podania p WHERE p.podId = :podId"),
    @NamedQuery(name = "Podania.findByImie", query = "SELECT p FROM Podania p WHERE p.imie = :imie"),
    @NamedQuery(name = "Podania.findByNazwisko", query = "SELECT p FROM Podania p WHERE p.nazwisko = :nazwisko"),
    @NamedQuery(name = "Podania.findByAdres", query = "SELECT p FROM Podania p WHERE p.adres = :adres"),
    @NamedQuery(name = "Podania.findByLimitWyplat", query = "SELECT p FROM Podania p WHERE p.limitWyplat = :limitWyplat")})
public class Podania implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "POD_ID")
    private Integer podId;
    @Column(name = "IMIE")
    private String imie;
    @Column(name = "NAZWISKO")
    private String nazwisko;
    @Column(name = "ADRES")
    private String adres;
    @Column(name = "LIMIT_WYPLAT")
    private BigDecimal limitWyplat;
    @JoinColumn(name = "U_NAME", referencedColumnName = "U_NAME")
    @ManyToOne
    private Users uName;

    public Podania() {
    }

    public Podania(Integer podId) {
        this.podId = podId;
    }

    public Integer getPodId() {
        return podId;
    }

    public void setPodId(Integer podId) {
        this.podId = podId;
    }

    public String getImie() {
        return imie;
    }

    public void setImie(String imie) {
        this.imie = imie;
    }

    public String getNazwisko() {
        return nazwisko;
    }

    public void setNazwisko(String nazwisko) {
        this.nazwisko = nazwisko;
    }

    public String getAdres() {
        return adres;
    }

    public void setAdres(String adres) {
        this.adres = adres;
    }

    public BigDecimal getLimitWyplat() {
        return limitWyplat;
    }

    public void setLimitWyplat(BigDecimal limitWyplat) {
        this.limitWyplat = limitWyplat;
    }

    public Users getUName() {
        return uName;
    }

    public void setUName(Users uName) {
        this.uName = uName;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (podId != null ? podId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Podania)) {
            return false;
        }
        Podania other = (Podania) object;
        if ((this.podId == null && other.podId != null) || (this.podId != null && !this.podId.equals(other.podId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entity.Podania[podId=" + podId + "]";
    }

}
